import request from '@/utils/request'

// 封装企业部门列表
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}

// 封装根据id删除部门
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 新增部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据ID查询部门详情
export function getWriteById(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 根据ID修改部门详情
export function writeDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
